/***********************************************************************
    filename:   DaterCalendarDay.h
    created:    10/4/2012
    author:     4Ys

    purpose:    Defines the day class used in calendar
*************************************************************************/
#ifndef _DaterCalendarDay_h_
#define _DaterCalendarDay_h_

#include <vector>
#include "DaterEvent.h"

namespace Dater
{
	class CalendarMonth;

	/*!
	\brief
		An entity class basely used by calendars.
	*/
	class CalendarDay
	{
	public:
		/*!
		 \brief
			 Constructor of class CalendarDay.

		 \param year
		      - an integer means year.

		 \param month
			  - an integer means month.

		 \param day
		      - an integer means day.
		 
		 \param useID
		      - an integer means useID.
			  - useID points to a disdinct user.

		 \param weekDay
		      - an integer means weekDay.
			  - -1 means not being given.
		*/
		CalendarDay(int year, int month, int day, int weekDay = -1,int yearDay = -1);

		/*!
		 \brief
			 Return value _year.

		 \return
			 an integer means year.
		*/
		int getYear();

		/*!
		 \brief
			 Return value _month.

		 \return
			 an integer means month.
		*/
		int getMonth();

		/*!
		 \brief
			 Return value _day.

		 \return
			 an integer means day.
		*/
		int getDay();

		/*!
		 \brief
			 Return value _weekDay.

		 \return
			 an integer means weekday.
		*/
		int getWeekDay();


		/*!
		 \brief
			 Return value _yearDay.

		 \return
			 an integer means yearday.
		*/
		int getYearDay();

		/*!
		 \brief
		     Clone a new date.

		 \return
		     Return a new date cloned by the prototype date.
		*/
		CalendarDay* Clone() const;

		void addEvent(Event*);

		void deleteEvent(Event*);

		std::vector<Event*> getEvents(){return _events;}

	private:
		friend class CalendarMonth;
		/*!
		 \brief
			 Assign a new class Date with an existed class Date.

		 \param 
		      - an address of Date.

		 \return
			 nothing.
		*/
		CalendarDay(const CalendarDay&);

		/*!
		 \brief
			 Assign a new class Date with an existed class Date using the operator 'equal'.

		 \param 
		      - an address of Date.

		 \return
			 a pointor to this class Date.
		*/
		CalendarDay& operator=(const CalendarDay&) {return *this;}

		/*!
		 \brief
			 set value _year.
				 
		 \param year
		      - an integer means year.
		*/
		void setYear(int year);

		/*!
		 \brief
			 set value _month.

		 \param month
			  - an integer means month.
		*/
		void setMonth(int month);

		/*!
		 \brief
			 set value _day.

		 \param day
		      - an integer means day.
		*/
		void setDay(int day);

		/*!
		 \brief
			 set value _weekDay.

		 \param weekDay
		      - an integer means weekDay
		*/
		void setWeekDay(int weekDay);


		/*!
		 \brief
			 set value _yearDay.

		 \param yearDay
		      - an integer means yearDay
		*/
		void setYearDay(int yearDay);

		/*!
		 - an integer of this date means year.
		 - since 1970.
		*/
		int _year;

		/*!
		 an integer of this date means month.
		*/
		int _month;

		/*!
		 an integer of this date means day.
		*/
		int _day;

		/*!
		 - an integer of this date means weekday.
		 - -1 means not being given.
		*/
		int _weekDay;

		
		/*!
		 - an integer of this date means weekday.
		 - -1 means not being given.
		*/
		int _yearDay;

		std::vector<Event*> _events;
	};

}

#endif